home *** CD-ROM | disk | FTP | other *** search
- Path: gail.ripco.com!mambuhl
- From: mambuhl@ripco.com (Martin Ambuhl)
- Newsgroups: comp.lang.c
- Subject: Re: Programming Question
- Date: 4 Mar 1996 03:37:17 GMT
- Organization: Ripco Communications, Inc.
- Message-ID: <4hdohd$e67@gail.ripco.com>
- NNTP-Posting-Host: foley.ripco.com
-
- ebromber@forest.drew.edu
- in <1996Mar3.164754.137341@forest> asks:
-
- >.... However,
- >wheneve I run the program, the "ENTER PASSWORD HERE" only appears after a
- >carriage return is entered....
- >... Does
- >anyone know why and how I can fix this?
-
- The output stream is buffered. This means that your program can write to
- stdout without waiting for the final output to actually occur.
- There is nothing in
- > printf("ENTER PASSWORD HERE: ");
- to trigger dumping the buffer to stdout.
-
- One way to do this is to just insert
- fflush(stdout);
- before you start trying to get input.
-
- --
- * Martin Ambuhl net: mambuhl@ripco.com
- * Chicago, IL (USA)
-